package com.ruoyi.web.controller.kaoyan.vo;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.kaoyan.domain.EducationUnbindRecord;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

/**
 * 解绑vo类
 * @author admin
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UnbindVo {

    private Long id;

    private Long userId;
    private String userName;
    private Long partnerUserId;
    private String partnerUserName;

    private String bindFlag;

    private String comment;
    private String applyMessage;


    public UnbindVo(EducationUnbindRecord record, Map<Long, String> user2Map, Map<Long, String> partnerMap){
        this.id = record.getId();
        this.userId = record.getUserId();
        this.userName = user2Map.get(record.getUserId());
        this.partnerUserId = record.getPartnerUserId();
        this.partnerUserName = partnerMap.get(record.getPartnerUserId());
        this.comment = record.getComment();
        this.applyMessage = record.getApplyMessage();
        this.bindFlag = StringUtils.isNull(record.getBindFlag()) ? "null" : record.getBindFlag().toString();
    }
}
